@echo off

"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\SqlMetal.exe" /server:iosqlsrv08 /database:SplendidCRM /dbml:SplendidDBMap.dbml /views 

SqlMetalInclude.exe /map:SplendidDBMap.dbml /include:vwMODULES_USERS_Cross=Module,vwEDITVIEWS,vwEDITVIEWS_FIELDS=EditViewField,vwGRIDVIEWS,vwGRIDVIEWS_COLUMNS=GridViewColumn,vwMODULES,vwTERMINOLOGY_List=Terminology,NOTES=Note,NOTE_ATTACHMENTS=NoteAttachment,DOCUMENTS=Document,DOCUMENT_REVISIONS=DocumentRevision,vwUSERS,vwRELATIONSHIPS,vwTEAM_MEMBERSHIPS,vwTASKS=Task,vwPROJECT_TASKS=ProjectTask /outFile:output.dbml

"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\SqlMetal.exe" output.dbml /code:%~dp0Splendid.designer.cs /language:csharp /namespace:SplendidCRM.WCF.Data /context:SplendidDataContext /serialization:Unidirectional
pause